package com.itheima;

import java.util.ArrayList;
import java.util.List;

public class Demo3 {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();

        list.add("张三丰");
        list.add("王思聪");
        list.add("张飞");
        list.add("刘晓敏");
        list.add("张靓颖");

        list.stream().filter(s->s.startsWith("张")).forEach(s-> System.out.println(s));
        long count = list.stream().filter(s->s.startsWith("张")).count();
        System.out.println(count);
    }
}
